home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / uconv / nsITextToSubURI.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  7KB  |  155 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsITextToSubURI.idl
  3.  */
  4.  
  5. #ifndef __gen_nsITextToSubURI_h__
  6. #define __gen_nsITextToSubURI_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. // {8B042E22-6F87-11d3-B3C8-00805F8A6670}
  18. #define NS_TEXTTOSUBURI_CID { 0x8b042e22, 0x6f87, 0x11d3, { 0xb3, 0xc8, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 } }
  19. #define NS_ITEXTTOSUBURI_CONTRACTID "@mozilla.org/intl/texttosuburi;1"
  20.  
  21. /* starting interface:    nsITextToSubURI */
  22. #define NS_ITEXTTOSUBURI_IID_STR "8b042e24-6f87-11d3-b3c8-00805f8a6670"
  23.  
  24. #define NS_ITEXTTOSUBURI_IID \
  25.   {0x8b042e24, 0x6f87, 0x11d3, \
  26.     { 0xb3, 0xc8, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0x70 }}
  27.  
  28. class NS_NO_VTABLE nsITextToSubURI : public nsISupports {
  29.  public: 
  30.  
  31.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITEXTTOSUBURI_IID)
  32.  
  33.   /* string ConvertAndEscape (in string charset, in wstring text); */
  34.   NS_IMETHOD ConvertAndEscape(const char *charset, const PRUnichar *text, char **_retval) = 0;
  35.  
  36.   /* wstring UnEscapeAndConvert (in string charset, in string text); */
  37.   NS_IMETHOD UnEscapeAndConvert(const char *charset, const char *text, PRUnichar **_retval) = 0;
  38.  
  39.   /**
  40.    * Unescapes the given URI fragment (for UI purpose only)
  41.    * Note: 
  42.    * <ul>
  43.    *  <li> escaping back the result (unescaped string) is not guaranteed to 
  44.    *       give the original escaped string
  45.    *  <li> In case of a conversion error, the URI fragment (escaped) is 
  46.    *       assumed to be in UTF-8 and converted to AString (UTF-16)
  47.    *  <li> Always succeeeds (callers don't need to do error checking)
  48.    * </ul>
  49.    *
  50.    * @param aCharset the charset to convert from
  51.    * @param aURIFragment the URI (or URI fragment) to unescape
  52.    * @return Unescaped aURIFragment  converted to unicode
  53.    */
  54.   /* AString unEscapeURIForUI (in ACString aCharset, in AUTF8String aURIFragment); */
  55.   NS_IMETHOD UnEscapeURIForUI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval) = 0;
  56.  
  57.   /**
  58.    * Unescapes only non ASCII characters in the given URI fragment 
  59.    * note: this method assumes the URI as UTF-8 and fallbacks to the given charset
  60.    * in case the data is not UTF-8
  61.    *
  62.    * @param aCharset the charset to convert from
  63.    * @param aURIFragment the URI (or URI fragment) to unescape
  64.    * @return Unescaped aURIFragment  converted to unicode
  65.    * @throws NS_ERROR_UCONV_NOCONV when there is no decoder for aCharset
  66.    *         or error code of nsIUnicodeDecoder in case of conversion failure
  67.    */
  68.   /* AString unEscapeNonAsciiURI (in ACString aCharset, in AUTF8String aURIFragment); */
  69.   NS_IMETHOD UnEscapeNonAsciiURI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval) = 0;
  70.  
  71. };
  72.  
  73. /* Use this macro when declaring classes that implement this interface. */
  74. #define NS_DECL_NSITEXTTOSUBURI \
  75.   NS_IMETHOD ConvertAndEscape(const char *charset, const PRUnichar *text, char **_retval); \
  76.   NS_IMETHOD UnEscapeAndConvert(const char *charset, const char *text, PRUnichar **_retval); \
  77.   NS_IMETHOD UnEscapeURIForUI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval); \
  78.   NS_IMETHOD UnEscapeNonAsciiURI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval); 
  79.  
  80. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  81. #define NS_FORWARD_NSITEXTTOSUBURI(_to) \
  82.   NS_IMETHOD ConvertAndEscape(const char *charset, const PRUnichar *text, char **_retval) { return _to ConvertAndEscape(charset, text, _retval); } \
  83.   NS_IMETHOD UnEscapeAndConvert(const char *charset, const char *text, PRUnichar **_retval) { return _to UnEscapeAndConvert(charset, text, _retval); } \
  84.   NS_IMETHOD UnEscapeURIForUI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval) { return _to UnEscapeURIForUI(aCharset, aURIFragment, _retval); } \
  85.   NS_IMETHOD UnEscapeNonAsciiURI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval) { return _to UnEscapeNonAsciiURI(aCharset, aURIFragment, _retval); } 
  86.  
  87. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  88. #define NS_FORWARD_SAFE_NSITEXTTOSUBURI(_to) \
  89.   NS_IMETHOD ConvertAndEscape(const char *charset, const PRUnichar *text, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConvertAndEscape(charset, text, _retval); } \
  90.   NS_IMETHOD UnEscapeAndConvert(const char *charset, const char *text, PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnEscapeAndConvert(charset, text, _retval); } \
  91.   NS_IMETHOD UnEscapeURIForUI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnEscapeURIForUI(aCharset, aURIFragment, _retval); } \
  92.   NS_IMETHOD UnEscapeNonAsciiURI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnEscapeNonAsciiURI(aCharset, aURIFragment, _retval); } 
  93.  
  94. #if 0
  95. /* Use the code below as a template for the implementation class for this interface. */
  96.  
  97. /* Header file */
  98. class nsTextToSubURI : public nsITextToSubURI
  99. {
  100. public:
  101.   NS_DECL_ISUPPORTS
  102.   NS_DECL_NSITEXTTOSUBURI
  103.  
  104.   nsTextToSubURI();
  105.  
  106. private:
  107.   ~nsTextToSubURI();
  108.  
  109. protected:
  110.   /* additional members */
  111. };
  112.  
  113. /* Implementation file */
  114. NS_IMPL_ISUPPORTS1(nsTextToSubURI, nsITextToSubURI)
  115.  
  116. nsTextToSubURI::nsTextToSubURI()
  117. {
  118.   /* member initializers and constructor code */
  119. }
  120.  
  121. nsTextToSubURI::~nsTextToSubURI()
  122. {
  123.   /* destructor code */
  124. }
  125.  
  126. /* string ConvertAndEscape (in string charset, in wstring text); */
  127. NS_IMETHODIMP nsTextToSubURI::ConvertAndEscape(const char *charset, const PRUnichar *text, char **_retval)
  128. {
  129.     return NS_ERROR_NOT_IMPLEMENTED;
  130. }
  131.  
  132. /* wstring UnEscapeAndConvert (in string charset, in string text); */
  133. NS_IMETHODIMP nsTextToSubURI::UnEscapeAndConvert(const char *charset, const char *text, PRUnichar **_retval)
  134. {
  135.     return NS_ERROR_NOT_IMPLEMENTED;
  136. }
  137.  
  138. /* AString unEscapeURIForUI (in ACString aCharset, in AUTF8String aURIFragment); */
  139. NS_IMETHODIMP nsTextToSubURI::UnEscapeURIForUI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval)
  140. {
  141.     return NS_ERROR_NOT_IMPLEMENTED;
  142. }
  143.  
  144. /* AString unEscapeNonAsciiURI (in ACString aCharset, in AUTF8String aURIFragment); */
  145. NS_IMETHODIMP nsTextToSubURI::UnEscapeNonAsciiURI(const nsACString & aCharset, const nsACString & aURIFragment, nsAString & _retval)
  146. {
  147.     return NS_ERROR_NOT_IMPLEMENTED;
  148. }
  149.  
  150. /* End of implementation class template. */
  151. #endif
  152.  
  153.  
  154. #endif /* __gen_nsITextToSubURI_h__ */
  155.